<?php

namespace Controller;

abstract class Base extends \Lib\Core\Controller {

	public function actionBefore() {
        $this->setCurrentMenu(array(0, 0));
        $this->setResourcePath('');
        $this->assign('_menu', \Entity\Menu::instance()->menu);
        $this->assign('_metaTitle', '');
		$this->assign('_metaKeywords', '');
		$this->assign('_metaDescription', '');
		$this->uri = $_SERVER['REQUEST_URI'];
		$this->assign('_uri', $this->uri);
		$this->setStaticFileVersion('1.0');
	}

    public function setCurrentMenu($arr) {
        $this->assign('_currentMenu', $arr);
    }

	public function setMeta($title, $keywords = '', $description = '') {
		$webName = '';
		if ($title) {
			$title = $webName . ' - ' . $title;
		} else {
			$title = $webName;
		}
		$this->assign('_metaTitle', $title);
		if ($keywords) {
			$this->assign('_metaKeywords', $keywords);
		}
		if ($description) {
			$this->assign('_metaDescription', $description);
		}
	}

}
